<%@page import="com.glowdayz.common.DBHandler"%>
<%@page import="com.glowdayz.glowmee.cmd.CommonCodeCMD"%>
<%@page import="java.util.ArrayList"%>
<%@ page import="com.glowdayz.glowmee.dao.CommonCodeDAO"%>
<%@ page language="java" contentType="text/xml; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page trimDirectiveWhitespaces="true" %>
<%
	String sido = request.getParameter("sido");

	if (sido.equals("default")) {
	%>
<?xml version="1.0" encoding="utf-8" ?>
<sido>
	<item>
		<idCommon>defalut</idCommon>
		<commonText>시/도를 선택하세요</commonText>
	</item>
</sido>
	<%	
		return;
	}
	DBHandler.getInstance().connect();
	CommonCodeDAO commonDao = CommonCodeDAO.getInstance();
	ArrayList<CommonCodeCMD> cmd = commonDao.getCommonCodeList(null, "parentId=" + sido);
%>
<?xml version="1.0" encoding="utf-8" ?>
<sido>
	<item>
		<idCommon>defalut</idCommon>
		<commonText>--- 구/군 ---</commonText>
	</item>
	<%
		for (int i=0; i<cmd.size(); i++) {
			CommonCodeCMD temp = cmd.get(i);
	%>
	<item>
		<idCommon><%= temp.getIdCommon() %></idCommon>
		<commonText><%= temp.getCommonText() %></commonText>
	</item>
	<%
		}
		DBHandler.getInstance().disconnect();
	%>
</sido>